
//获取应用实例
const app = getApp()

Page({
  data: {
    partyOrg: null,
    wh:0
  },
  onShow: function () {
    var that = this;
    wx.getSystemInfo({
      success: function (res) {
        that.setData({
          "wh": res.windowHeight - 48 -wx.getSystemInfoSync().statusBarHeight
        })
      }
    })
  },
  onLoad: function () {
    var that = this;
    wx.request({
      url: 'https://www.xinhuo.site/api/partyOrg/detail',
      data: {
        userId: app.globalData.userId
      },
      method: 'POST',
      header: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      success(res) {
        if (res.data.syscode == 0) {
          that.setData({
            partyOrg: res.data.partyOrg
          });
        }
        else if (res.data.syscode == 1) {
          wx.showToast({
            title: '请登录',
            icon: 'none'
          });
        }
      }
    });
  }
});